home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / programs / prog59 < prev    next >
Encoding:
Text File  |  1995-06-29  |  386 b   |  22 lines

  1. # testing for a memory leak
  2.  
  3. proc incr_label {} {
  4.     global timer
  5.  
  6.     .lab getValues -labelString n
  7.     incr n
  8.     .lab setValues -labelString $n
  9.     set timer [. addTimer 1 incr_label]
  10. }
  11.  
  12. xtAppInitialize
  13.  
  14. xmPushButton .lab managed -labelString 1000
  15. .lab activateCallback {. removeTimer $timer; .lab destroyWidget}
  16.  
  17. set timer [. addTimer 1000 incr_label]
  18.  
  19. . realizeWidget
  20.  
  21. . mainLoop
  22.